home *** CD-ROM | disk | FTP | other *** search
/ Internet Tools (InfoMagic) / Internet Tools.iso / news / moderating / mod.procmail.Z / mod.procmail
Internet Message Format  |  1994-05-06  |  4KB

  1. From sridhar@homecheese.eas.asu.edu Wed Apr 20 15:40:49 1994
  2. Received: from homecheese.eas.asu.edu by sparky.sterling.com 
  3.     id AA18215; Wed, 20 Apr 1994 15:40:38 -0500
  4. Return-Path: <sridhar@homecheese.eas.asu.edu>
  5. Received: from localhost (sridhar@localhost) by homecheese.eas.asu.edu (8.6.4/8.6.4) id NAA07183; Wed, 20 Apr 1994 13:45:37 -0700
  6. Date: Wed, 20 Apr 1994 13:45:36 -0700 (MST)
  7. From: Sridhar Venkataraman <sridhar@asuvax.eas.asu.edu>
  8. Subject: Moderator stuff.. Procmail help..
  9. To: kent@sterling.com
  10. Message-Id: <Pine.3.89.9404201325.A7154-0100000@homecheese.eas.asu.edu>
  11. Mime-Version: 1.0
  12. Content-Type: TEXT/PLAIN; charset=US-ASCII
  13. Status: OR
  14.  
  15.  
  16. Kent,
  17.  
  18. This is intended for anyone having access to procmail.
  19. Feel free to archive or ignore or whatever. :-)
  20.  
  21. Sridhar.
  22. -------
  23. # Using Procmail to moderate a Usenet group. 
  24. # .procmailrc
  25. # by Sridhar Venkataraman <sridhar@asuvax.eas.asu.edu>
  26. # for rec.food.veg.cooking.
  27. # Short guide to conditions in recipes...
  28. # c - continue
  29. # f - consider the pipe as filter
  30. # h - Feed the header to pipe.
  31. # A - depends on last successful recipe.
  32.  
  33.  
  34. # This recipe converts any mail submissions to the moderation address to appear
  35. # like posting submissions.
  36.  
  37. :cf
  38. ^TOrfvc-mod@utcc.utoronto.ca
  39. | formail -I "To: rec-food-veg-cooking@uunet.uu.net" -a "Newsgroups: rec.food.veg.cooking"
  40.  
  41. # The following recipe recognized the submissions which are sent by
  42. # the psuedo-user news.  In this case, the complete posting appears
  43. # just after the header. Hence the header is chopped.
  44.  
  45. :0cf
  46. * ^From:.*news@
  47. * ^TO.*rec-food-veg-cooking@
  48. | sed -n '2,/^Path:/\!p' | formail -a "To: rec-food-veg-cooking@"
  49.  
  50.  
  51. # This is the start of the recipe cluster that recognizes a submission
  52. # to rec.food.veg.cooking.  Saves a copy in the folder rfvc.
  53.  
  54. :c
  55. ^TOrec-food-veg-cooking@
  56. rfvc
  57.  
  58. # Save the Newsgroups, Subject, From, Date in some variables.
  59.  
  60.     :Ach
  61.     newsgroups=|formail -a "Newsgroups: rec.food.veg.cooking" \
  62.                 -x "Newsgroups:"
  63.     :Ach
  64.     subject=|formail -x "Subject:"
  65.     :Ach
  66.     date=|formail -x "Date:"
  67.     :Ach
  68.     from=|formail -x "From:"
  69.     :Ach
  70.     replyto=|formail -rtx "To:"
  71.  
  72. # If the poster doesn't want autoreplies, he supplies a keyword of
  73. # ignore in the posting. The following recipe appends the poster's
  74. # address to the file $HOME/system/rfvc.
  75.  
  76.     :0 Ach:rfvc.lock
  77.     * Keywords:.*ignore
  78.     | (cat > /dev/null ; echo "$replyto" >> $HOME/system/rfvc)
  79.  
  80. # If the poster doesn't appear in the above file, he/she gets an
  81. # autoreply. This way I have been able to fix several machines'
  82. # reply-able addresses. Also people don't wonder why they don't see
  83. # the posting immediately on moderated groups.
  84.  
  85.     :0 Ach:rfvc.lock
  86.     * !?grep -i $replyto $HOME/system/rfvc
  87.     | (formail -rt -I "Subject: Acknowledgement [l/m 94/03/02]" -i "Received:" \
  88.     -I "From: rfvc submissions <rfvc-request@utcc.utoronto.ca>" ; \
  89.     echo "From:\t\t$from\nDate:\t$date\nNewsgroups:\t$newsgroups\nSubject:\t$subject" ; \
  90.     cat /usr/people/sridhar/misc/rfvc/rec )| $SENDMAIL -t -oi 
  91.  
  92. # Finally the unnecessary headers are ripped off and the bare
  93. # essentials (headers + body) are saved as a MH-style folder. Each
  94. # posting is saved as a file. You can peruse the postings, make any
  95. # changes if need be and use "inews -h < <file>" to post any file.
  96.  
  97.  
  98.     :Acf
  99.     | formail -I "Apparently-To:" -I "To:" -I "Date:" \
  100.           -a "Newsgroups: rec.food.veg.cooking" \
  101.       -I "Sender:"\
  102.       -I "Path:"\
  103.       -a "Organization: -" \
  104.       -a "Archive-Name: " \
  105.       -a "Followup-To: " \
  106.           -I "Lines:" \
  107.           -I "In-Reply-To:" \
  108.       -I "Approved: sridhar@asuvax.eas.asu.edu" \
  109.       -I "X-Newsreader:" \
  110.       -I "Nntp-Posting-Host:" -I "Originator:" \
  111.           -I "Received:" -I "Return-Path:" |  tail +2 
  112.  
  113.     :Ac
  114.     $HOME/misc/rfvc/misc/.
  115.  
  116. # Just to get a copy of headers for quick overview. 
  117.  
  118.     :Ah
  119.     /usr/mail/sridhar
  120.  
  121. # In case of questions on procmail refer the appropriate manual pages.
  122. # In case of any specific questions on the above recipes, you can get
  123. # hold of me - Sridhar <sridhar@asuvax.eas.asu.edu>
  124.  
  125.  
  126.  
  127.  
  128.